function checkform (form, username) {
    if(username == "true")
    {
        var username = form.username.value;
        if (username == "") {
            alert ("Please enter a username");
            form.username.focus();
            return false;
        }
        if (username.length < 3 ){                    
            alert ("Username should be at least 3 characters long");
            form.username.focus();                    
            return false;
        }
        if (!((username.charAt(0) >= 'a' && username.charAt(0) <= 'z') || (username.charAt(0) >= 'A' && username.charAt(0) <= 'Z')) ) {
            alert ("Username has to start with a letter");
            form.username.focus();
            return false;
        }
    }    
                
    var fullName = form.fullName.value;
                
    if (fullName == "") {
        alert ("Please enter your name");
        form.fullName.focus();                    
        return false;
    }
    if (fullName.match(/^[a-zA-Zé]+\s[a-zA-Zé]+$/) != fullName) {
        alert ("Please enter your full name");
        form.fullName.focus();                    
        return false;                    
    }
                    
                
    var email = form.email.value;
                
    var AtPos = email.indexOf("@")
    StopPos = email.lastIndexOf(".")
    if (email == "") {
        alert ("Please enter a email adress");
        form.email.focus();                    
        return false;
    }
    if (email.match(/^[A-Za-z0-9\.\-_]+@[A-Za-z0-9\.\-_]+\.[A-Za-z0-9\.\-_]+$/) != email ) {
        alert ("Please enter a valid email adress");
        form.email.focus();                    
        return false;
    }
                
    var password = form.password.value;
                
    if (password == ""){
        alert ("Please enter a password");
        form.password.focus();                    
        return false;
    }
                
    if (password != form.password2.value){
        alert ("Passwords don't match");
        form.password.focus();                    
        return false;
    }
                
    if (password.length < 3){
        alert ("Password should be at least 3 characters long");
        form.password.focus();                    
        return false;
    }
                
    return true;                
}